package GUI;

import java.awt.Toolkit;

/**
 *
 * @author kaiooliveira
 */
public class janelaCadastroConcluido extends javax.swing.JFrame {
	
	private static String arqEstabelecimentos;
	private static String arqOpinioes;
	
	/**
	 * Construtor da janela de cadastro
	 * @param rest
	 * 		caminho do arquivo
	 * @param opini
	 * 		caminho do arquivo
	 */
	public janelaCadastroConcluido(String rest, String opini) {
		this.arqEstabelecimentos = rest;
		this.arqOpinioes = opini;
		initComponents();
	}

    /**
     * Inicia os componentes da janela
     */
    @SuppressWarnings("unchecked")
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 36)); // NOI18N
        jLabel1.setText("Cadastro concluído com sucesso!");
        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/Checked.png"))); // NOI18N

        jButton1.setText("Voltar ao menu principal");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .addContainerGap()
                        .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .add(layout.createSequentialGroup()
                        .add(199, 199, 199)
                        .add(jButton1)))
                .addContainerGap())
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(275, Short.MAX_VALUE)
                .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 140, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(202, 202, 202))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(26, 26, 26)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 76, Short.MAX_VALUE)
                .add(jButton1)
                .add(68, 68, 68))
        );

        pack();
    }

    /**
     * Fechar janela
     * @param evt
     * 		evento do mouse
     */
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    	this.dispose();
    	new MenuPrincipal(arqEstabelecimentos,arqOpinioes).setVisible(true);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
            	Toolkit.getDefaultToolkit().beep();
                new janelaCadastroConcluido(arqEstabelecimentos,arqOpinioes).setVisible(true);
            }
        });
    }
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
}
